-
-
Notifications
You must be signed in to change notification settings - Fork 157
support docsify init --plugins #99
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you removed the main readme ! please revert it .
there are unncessary files like .nojekyll
, index.html
etc in root. Please check.
please add tests as well
sorry about that! have no idea where those came from 👀 by tests do you mean adding a test to the ava snapshot e2e ? Thanks ! |
okay so I added tests but in order to do that I had to change the test structure a bit to accept command help. let me know what you think 🤘🏼 |
Thanks ! I will review it soon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologizes for the delay. Completely lost track of this.
@anikethsaha is that possible to re-review? |
lib/commands/init.js
Outdated
replace(target(filename), '_plugins_', '_plugin\n '.repeat(plugins.length)) | ||
plugins.forEach(plugin => { | ||
const major = version[0] | ||
const url = plugin.includes('//') ? plugin : `https://cdn.jsdelivr.net/npm/docsify@${major}/lib/plugins/${plugin}.min.js` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the enquirer in #117, you can use this here as well.
see https://github.com/enquirer/enquirer#multiselect-prompt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we should support specifying a list of plugins as an argument to --plugins
such that the prompt shows up on not supplying any or passing in an unsupported plugin.
docsify init [path] --plugins, -p [...plugins]
resolve #99 (comment) . When executing the |
The success message should come after the prompt. |
Co-authored-by: James George <jamesgeorge998001@gmail.com>
done. |
@jamesgeorge007 Thank you for the modifications 790e96c But there seems to be some problems:
|
Good catch. I've pushed a fix |
having a go at #98 .
command:
init
option:
--plugins, -p
plugins are now supported via the following usage:
docsify init docs/ -p search gitalk <some_other_plugin>
note that by default a plugin will be added as a script tag with a url pointing to
https://unpkg.com/docsify/lib/plugins/<plugin_name>
otherwise it will use the url provided as an argument.example and documentation was added to
docs/README